|
|
|
|
|
|
|
The routine in Listing 19.18 asks for the control to read the column number and the character used to delimit the columns in the list control. It takes this information and returns a string that can be used to populate a text control (or any other control) on a data-entry form. You learn how to use this in your data-entry forms in the next section. |
|
|
|
|
|
|
|
|
Now that you have a method for retrieving a row and each field, you're ready to build the routines that handle moving the record pointer and loading the caller's form. Listing 19.19 shows all the code for the MoveFirst, MoveNext, MovePrevious, and MoveLast methods of the class. Add these methods to your project. |
|
|
|
|
|
|
|
|
Listing 19.19. Coding the Move methods for the class. |
|
|
|
|
|
|
|
|
Public Sub MoveFirst(frmTemp As Object)
'
' move items from rtb into form controls
'
Dim strRecLine As String
'
' position record pointer
intRecNum = 1
'
GetSQLRec intRecNum, strRecLine, frmTemp
'
End Sub
Public Sub MoveLast(frmTemp As Object)
'
' move items from rtb into form controls
'
Dim strRecLine As String
'
' position record pointer
intRecNum = intRecordCount
'
GetSQLRec intRecNum, strRecLine, frmTemp
'
End Sub
Public Sub MovePrevious(frmTemp As Object)
'
' move items from rtb into form controls
'
Dim strRecLine As String
'
' position record pointer
If intRecNum > 1 Then
intRecNum = intRecNum - 1
Else
intRecNum = 1
End If
'
GetSQLRec intRecNum, strRecLine, frmTemp |
|
|
|
|
|